//
//  CorP5eSession.h
//  CorP5e
//
//  Created by Matthew Giant on 9/27/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

@class CorP5eFilter;
@class CorP5eMovie;
@class CorP5eMovieInfo;
@class CorP5eSession;

@interface CorP5eSession : NSObject {
	NSUInteger			seqId;		
		//sequence for ids for created objects

	NSMutableDictionary	*corP5eObjects;
		//dictionary mapping corP5e Object id values to filter, movie objects
	
	CGColorSpaceRef defaultSpace;
}

+ (CorP5eSession *)instance;
	//returns the singleton intance of CorP5eSession

- (id)init;

- (NSUInteger)createFilter:(const NSString *)filterName;
	//Instantiates a new filter

- (CorP5eFilter *)filterWithId:(NSUInteger)filterId;

- (void)removeObjectWithId:(NSUInteger)filterId;

/** returns a CIImage based on the passed in java/PImage formated data **/
- (CIImage *)makeCIImageWithFormat:(int)pixelFormat
						   width:(NSUInteger)width
						  height:(NSUInteger)height
						  pixels:(UInt32 *)pixels;

/** returns a CGImage based on the passed in java/PImage formated data **/
- (CGImageRef)makeCGImageWithFormat:(int)pixelFormat
							  width:(NSUInteger)width
							 height:(NSUInteger)height
							 pixels:(UInt32 *)pixels;

- (void)renderImage:(CIImage *)img 
			   rect:(CGRect)rect 
		   toBuffer:(void *)buffer;


- (NSUInteger)createMovieWithInfo:(CorP5eMovieInfo *)info;

- (CorP5eMovie *)movieWithId:(NSUInteger)movieId;

@end
